export function checkUsername(){ //true, 合法; false, 不合法;
    let flag = true;
    let usernameValue = document.querySelector('#username').value;
    let errMsg = "";
    if(!/^\w{4,16}$/.test(usernameValue)){
        errMsg = "用户名不合法";
        flag = false;
    }
    document.querySelector('#name_msg').innerHTML = errMsg;
    return flag;
}


export function checkPhone(){ //true, 合法; false, 不合法;
    let flag = true;
    let phoneValue = document.querySelector('#phone').value;
    let errMsg = "";
    if(!/^1[3-9]\d{9}$/.test(phoneValue)){
        errMsg = "手机号不合法";
        flag = false;
    }
    document.querySelector('#phone_msg').innerHTML = errMsg;
    return flag;
}